<%@ page 
     import="java.util.Vector,
     com.softplus.carrefour.hd.CFHDSystem,
     com.softplus.carrefour.hd.bltier.entity.UserLevel,
     com.softplus.carrefour.hd.bltier.pc.ICaseHeadViewer,
     com.softplus.carrefour.hd.bltier.admin.IRoutePathControl,
     com.softplus.carrefour.hd.bltier.admin.IRoutePathViewer,
     com.softplus.carrefour.hd.bltier.admin.RoutePathManage
     "
     %>
<%
//com.softplus.carrefour.hd.bltier.admin.IRoutePathViewer

     //3 parameter should not null
     String    caseType        	= request.getParameter("ctype");// "";
     String    levelUser        = request.getParameter("luv");
     String    actionSelect  	= request.getParameter("asel");
     String	   cRptBy			= request.getParameter("cRptBy");
     Vector    levelVec    =    new Vector();
     
     RoutePathManage     routePathMan   =    (RoutePathManage)CFHDSystem.getControlClass("ROUTE_PATH");
//     RoutePathManage     routePath = new RoutePathManage();

		//levelVec =   routePathMan.getToUserLevelForCase(caseType,levelUser,actionSelect);
		if(!cRptBy.equals("")&& (levelUser.equals(UserLevel.LEVEL_2_AMS_ZONE_ASIA))){
			
			levelVec =   routePathMan.getToUserLevelForL2Z(caseType,levelUser,actionSelect);
		}else{
			levelVec =   routePathMan.getToUserLevelForCase(caseType,levelUser,actionSelect);
		}
		System.out.println("++caseType++"+caseType);
		System.out.println("++levelUser++"+levelUser);
		System.out.println("++actionSelect++"+actionSelect);
		System.out.println("++levelVec++"+levelVec.size());
%>
<select id="newULevel">
<%  
          for(int i=0; i<levelVec.size();i++) {
               String    levelData = (String) levelVec.elementAt(i);
               
%>
<option value="<%= levelData %>"><%= UserLevel.getLevelName(levelData) %></option>
<%
          }
%>
</select>

<script type="text/javascript">
<!--
     function transferSelectItem(){
               var pObj = parent.document.all.toUserLevel; //from //parent object 'to user level';
               var newObj = document.all.newULevel; //to ;
              // alert(pObj.length);
              // alert(pObj.length);
              
              // remove items the parent.
              for(var i=pObj.length; i>0; i--){
                    pObj.remove(i);
              }
              // transfer items from here to parent's select to user level.
              for(var j=0; j<newObj.length; j++){
                    var oOption = document.createElement("OPTION");
//                         alert(newObj(j).innerText);
                         pObj.options.add(oOption);
                         oOption.innerText =  newObj(j).innerText;
                         oOption.value        =  newObj(j).value;
                         
                         parent.window.status = 'text :'+newObj(j).innerText+' value: '+newObj(j).value;
              }
     }
     try{
     transferSelectItem();
     }catch(error){ }
-->
</script>